package companyTest.huawei;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int len=in.nextInt();
        String s=in.next();
        String[]nums=s.split("\\+");
        String num1[]=nums[0].split("\\.");
        String num2[]=nums[1].split("\\.");
        if (num1.length==1&&num2.length==1){
            System.out.println(add(num1[0],num2[0]));
        }else if ((num1.length==2&&num2.length==1)||(num1.length==1&&num2.length==2)){
            if (num2.length==2){
                String temp[]=num1;
                num1=num2;
                num2=temp;
            }
            String left=num1[0];
            String right=num1[1];
            left=add(left,num2[0]);
            while (right.length()>0&&right.charAt(right.length()-1)=='0'){
                right=right.substring(0,right.length()-1);
            }
            String ans;
            if (right.length()!=0)ans=left+"."+right;
            else ans=left;
            System.out.println(ans);
        }else {
            String left1=num1[0];
            StringBuilder right1= new StringBuilder(num1[1]);
            String left2=num2[0];
            StringBuilder right2= new StringBuilder(num2[1]);
            int maxLen=Math.max(right1.length(),right2.length());
            while (right1.length()<maxLen) right1.append("0");
            while (right2.length()<maxLen) right2.append("0");
            String right=add(right1.toString(),right2.toString());
            String left=add(left1,left2);
            if (right.length()>maxLen){
                left=add(left,"1");
                right=right.substring(1,right.length());
            }
            while (left.length()>0&&left.charAt(0)=='0'){
                left=left.substring(1);
            }
            if (left.length()==0)left="0";
            while (right.length()>0&&right.charAt(right.length()-1)=='0'){
                right=right.substring(0,right.length()-1);
            }
            String ans;
            if (right.length()!=0)ans=left+"."+right;
            else ans=left;
            System.out.println(ans);
        }
    }
    //两个自然数相加
    public static String add(String s1,String s2){
        if (s1.length()<s2.length()){
            String temp=s2;
            s2=s1;
            s1=s2;
        }
        int inSite=0;//进位
        StringBuilder sb=new StringBuilder();
        s1=new StringBuilder(s1).reverse().toString();
        s2=new StringBuilder(s2).reverse().toString();
        for (int i = 0; i <s2.length(); i++) {
            char c1=s1.charAt(i);
            char c2=s2.charAt(i);
            int sum=0;
            if (c1>='0'&&c1<='9'){
                sum=c1-'0'+c2-'0'+inSite;
            }else {
              if (c1=='!'||c2=='!'){
                  if (c2=='!'){
                      char temp=c2;
                      c2=c1;
                      c1=temp;
                  }
                  if (c2=='!'){
                      sum= inSite;
                  }else if (c2=='@'){
                      sum=13+inSite;
                  }else sum=4+inSite;
              }else if (c1=='@'||c2=='@'){
                  if (c2=='@'){
                      char temp=c2;
                      c2=c1;
                      c1=temp;
                  }
                  if (c2=='@'){
                      sum=7+inSite;
                  }else {
                      sum=20+inSite;
                  }
              }else {
                  sum=5+inSite;
              }
            }
            inSite=sum/10;
            sb.append(sum%10);
        }
        for (int i = s2.length(); i <s1.length() ; i++) {
            int sum=inSite+s1.charAt(i)-'0';
            inSite=sum/10;
            sb.append(sum%10);
        }
        if (inSite!=0)sb.append(inSite);
        return sb.reverse().toString();
    }
}
